{{group-membership-button model=model
    createNewMessageViaParams='createNewMessageViaParams'
    showLogin='showLogin'}}

{{#if hasMembers}}
  {{#load-more selector=".group-members tr" action="loadMore"}}
    <table class='group-members'>
      <thead>
        {{group-index-toggle order=order desc=desc field='username_lower' i18nKey='username'}}
        {{group-index-toggle order=order desc=desc field='last_posted_at' i18nKey='last_post'}}
        {{group-index-toggle order=order desc=desc field='last_seen_at'  i18nKey='last_seen'}}
      </thead>

      <tbody>
        {{#each model.members as |m|}}
          <tr>
            <td class='avatar'>
              {{#user-info user=m skipName=skipName}}
                {{#if m.owner}}<strong class="group-owner-label">{{i18n "groups.owner"}}</strong>{{/if}}
              {{/user-info}}
            </td>
            <td>
              <span class="text">{{bound-date m.last_posted_at}}</span>
            </td>
            <td>
              <span class="text">{{bound-date m.last_seen_at}}</span>
            </td>
          </tr>
        {{/each}}
      </tbody>
    </table>
  {{/load-more}}

  {{conditional-loading-spinner condition=loading}}
{{else}}
  <br>

  <div>{{i18n "groups.empty.members"}}</div>
{{/if}}
